package com.zhentao.controller;

import com.zhentao.model.common.buiness.dto.BuOrderStatusDto;
import com.zhentao.model.common.buiness.vo.BuOrderFindAllVO;
import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.service.BuOrdersService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/bu/order")
@Api("商家端：订单接口")
public class BuOrderController {
    @Autowired
    private BuOrdersService buOrdersService;

    /**
     * 商家端：订单查询所有
     * @param dto
     * @return
     */
    @PostMapping("/findAll")
    @ApiOperation("商家端：订单查询")
    public ResponseResult findAll(@RequestBody BuOrderFindAllVO dto){
        return buOrdersService.findAll(dto);
    }

    /**
     * 商家端：修改订单状态
     * @param dto
     * @return
     */
    @PostMapping("/orderStatus")
    @ApiOperation("商家端：修改订单状态")
    public ResponseResult orderStatus(@RequestBody BuOrderStatusDto dto){
        return buOrdersService.orderStatus(dto);
    }
}
